package my125;

public class SuanFa125 {
    public static void main(String[] args) {


    }


}

class Solution {
    public boolean isPalindrome(String s) {
        String s1 = s.replaceAll("[\\p{Punct}\\s\\p{InCJKUnifiedIdeographs}]", "").toLowerCase();
        char[] chars = s1.toCharArray();

        int n = chars.length;
        int left = 0;
        int right = n-1;


        while(right >= left){
            if (chars[left] != chars[right]){
                return false;

            }
            ++left;
            --right;
        }
      return  true;
    }

}
